package edu.ynu.se.xiecheng.achitectureclass.controller;

import edu.ynu.se.xiecheng.achitectureclass.common.controller.LogicController;
import edu.ynu.se.xiecheng.achitectureclass.dao.AirTemperatureDao;
import edu.ynu.se.xiecheng.achitectureclass.dto.DataDTO;
import edu.ynu.se.xiecheng.achitectureclass.entity.AirTemperature;
import edu.ynu.se.xiecheng.achitectureclass.service.AirTemperatureService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "空气温度实体的控制器")
@RestController
@RequestMapping("/airTemperature")
public class AirTemperatureController extends LogicController<AirTemperatureService, AirTemperatureDao, AirTemperature,Long> {
    public AirTemperatureController(AirTemperatureService service) {super(service);}

    @ApiOperation("获取最近7个空气温度的数据")
    @GetMapping("/get7Data")
    public List<DataDTO> get7Data(){
        return service.get7Data();
    }
}
